<?php
/**
 * Control how a page displays, it depends on the flag variable $_POST['noSidebar'].
 * @author Administrator
 *
 */
class TBB_Controller_Plugin_Sidebar extends Zend_Controller_Plugin_Abstract
{
	public function preDispatch(Zend_Controller_Request_Abstract $request)
	{
		$module = $request->module;
		$controller = $request->controller;
		$action = $request->action;		
		
		// if customer module
		if($module == "customer") {
			if($controller != "index") {
				$_POST['noSidebar'] = true;
			}
		}
		// if admin module
		else if($module == "admin") {
			if($controller == 'users' && $action == 'login') {
				$_POST['noSidebar'] = true;
			}
		}
	}
}